package com.xiaoran.user20012.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoran.user20012.entity.XrStore;
import com.xiaoran.user20012.mapper.XrStoreMapper;
import com.xiaoran.user20012.service.IXrStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xiaoRan
 * @since 2022-03-10
 */
@Service
public class XrStoreServiceImpl extends ServiceImpl<XrStoreMapper, XrStore> implements IXrStoreService {
    @Autowired
    XrStoreMapper mapper;

    @Override
    public Integer addOne(XrStore xrStore) {
        return mapper.insert(xrStore);
    }

    @Override
    public XrStore getOne(Long store_id) {
        return mapper.selectOne(new QueryWrapper<XrStore>()
                .eq("st_id", store_id));
    }

    @Override
    public List<XrStore> getAll() {
        return mapper.selectList(null);
    }
}
